package pe.edu.pucp.cpnc.mm.bean;

import java.io.Serializable;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlIDREF;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement
@XmlType(propOrder ={"posX","posY","occupied","isRoot", "objInside","tile"})
public class TileDetail implements Serializable {
    private Tile tile;
    private int posX;
    private int posY;
    private ObjectDetail objInside;
    private int isRoot;
    private int occupied;

    public TileDetail(){

    }

    public TileDetail(Tile tile, int posX, int posY){
            this.tile = tile;
            this.posX = posX;
            this.posY = posY;
            objInside = null;
            isRoot = 0;
            occupied = 0;
    }
    
    public TileDetail(TileDetail tDet, ObjectDetail objInside){
        tile = tDet.tile;
        posX = tDet.posX;
        posY = tDet.posY;
        this.objInside = objInside;
        isRoot = tDet.isRoot;
        occupied = tDet.occupied;
    }

    public Tile getTile() {
            return tile;
    }
    public void setTile(Tile tile) {
            this.tile = tile;
    }
    @XmlAttribute
    public int getPosX() {
            return posX;
    }
    public void setPosX(int posX) {
            this.posX = posX;
    }
    @XmlAttribute
    public int getPosY() {
            return posY;
    }
    public void setPosY(int posY) {
            this.posY = posY;
    }
    @XmlAttribute
    public int getOccupied() {
            return occupied;
    }
    public void setOccupied(int occupied) {
            this.occupied = occupied;
    }

    /**
     * @return the objInside
     */
    @XmlIDREF
    public ObjectDetail getObjInside() {
        return objInside;
    }

    /**
     * @param objInside the objInside to set
     */
    public void setObjInside(ObjectDetail objInside) {
        this.objInside = objInside;
    }

    /**
     * @return the isRoot
     */
    public int getIsRoot() {
        return isRoot;
    }

    /**
     * @param isRoot the isRoot to set
     */
    public void setIsRoot(int isRoot) {
        this.isRoot = isRoot;
    }

}
